package com.levis.huolalarobber;

import android.support.multidex.MultiDexApplication;

import com.tencent.bugly.crashreport.CrashReport;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.log.LoggerInterceptor;

import java.util.concurrent.TimeUnit;

import cn.jpush.android.api.JPushInterface;
import okhttp3.OkHttpClient;

/**
 * Created by levis on 2018/7/27/027.
 */

public class MainApplication extends MultiDexApplication {
    private static MainApplication mApplication;

    static public MainApplication getApplication() {
        return mApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mApplication = this;
        CrashReport.initCrashReport(getApplicationContext(), "d97756d04c", true);
        //chrome://inspect
//        Stetho.initializeWithDefaults(this);
        initOkGoUtil();
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
    }

    private void initOkGoUtil() {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .addInterceptor(new LoggerInterceptor("OKGO"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();
        OkHttpUtils.initClient(okHttpClient);
    }
}
